var barcode = require("./barcode.js");

function convert_length(length) {
  return Math.round(uni.getSystemInfoSync().windowWidth * length / 750);
}

function barc(id, code, width, height) {
  barcode.code128(uni.createCanvasContext(id), code, convert_length(width), convert_length(height));
}

module.exports = {
  barcode: barc
};